fix(lcms): stop plain MS jcamp from being detected as Chemstation LC/MS - #322
Open
headri wants to merge 2 commits into
Open
Conversation
A plain chem-spectra-generated MS export carries a MASS SPECTRUM root DATA TYPE that isChemstationLcms mistook for a genuine Chemstation LC/MS file. Bail out early on signatures unique to the plain export (SPECTRUM category, ##$CSSCANAUTOTARGET, the M/Z units triplet, or ##NTUPLES = MASS SPECTRUM), and tighten the remaining heuristic to require TIC/UVVIS category or multi-page metadata. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…veto The prior fix's early-return blacklist (SPECTRUM category, ##$CSSCANAUTOTARGET, ##NTUPLES=MASS SPECTRUM) ran before all positive LC/MS evidence, so it could override a genuine Chemstation export, and it relied on $CSCATEGORY parsing that silently dropped single (non-array) values. Its added (hasMultipleSpectra && hasPageMetadata) clause was also self-defeating: the original plain-MS fixture has multi-page structure too, so that clause alone reclassified it as LC/MS again. Fix the array-vs-string $CSCATEGORY read, drop the blanket blacklist, and narrow the veto to the one genuinely ambiguous case (multi-page MASS SPECTRUM root with no other chromatographic hint), gated only on the MS-specific units triplet and placed after all positive-evidence branches so it can never override them. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A plain chem-spectra-generated MS export carries a MASS SPECTRUM root DATA TYPE that isChemstationLcms mistook for a genuine Chemstation LC/MS file. Bail out early on signatures unique to the plain export (SPECTRUM category, ##$CSSCANAUTOTARGET, the M/Z units triplet, or ##NTUPLES = MASS SPECTRUM), and tighten the remaining heuristic to require TIC/UVVIS category or multi-page metadata.